<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>弹出确认框</title>
	</head>
	<body>
		<script>
			function f(){
				if(confirm("是否同意跳转至百度首页")){
					window.location="http://www.baidu.com";
				}
			}
			f()
		</script>
	</body>
</html>
